﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for ProductionOrder.xaml
    /// </summary>
    public partial class UILAGPL : ViewBase
    {

        public UILAGPL()
        {

        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            if (IsLoaded)
                return;
            base.Window_Loaded(sender, e);
        }

        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            if (dwMaster == null)
            {
                KEY = "".PadRight(12);
            }
            else
            {
                KEY = dwMaster["LPLO"].ToString() + dwMaster["LPLB"].ToString() + dwMaster["LPPLATZ"].ToString();
            }
        }
        public virtual void OnLPLOChg(string value)
        { }
        public virtual void OnLPLBChg(string value)
        { }
        public virtual void OnLPLPChg(string value)
        { }
        public override void ManageCommand(object sender, RoutedEventArgs e)
        {
            if (IsManage)
            {
                LOADBYAUF();
            }
            else
            {
                VICC_WFEVENTS.SVWF.DL02(RUNID);
            }
            base.ManageCommand(sender, e);
        }

    }
    public partial class UILAGPL : ViewBase
    {
        #region ==LPLO===========
        public static readonly DependencyProperty LPLOProperty = DependencyProperty.Register("LPLO",
            typeof(string), typeof(UILAGPL),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLPLOChanged));
        public string LPLO
        {
            get
            {
                return (string)GetValue(LPLOProperty);
            }
            set
            {
                SetValue(LPLOProperty, value);
                OnLPLOChg(value);
            }
        }
        private static void OnLPLOChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILAGPL;
            if (src != null)
            {
                src.LPLO = (string)e.NewValue;
            }
        }
        #endregion

        #region ==LPLB===========
        public static readonly DependencyProperty LPLBProperty = DependencyProperty.Register("LPLB",
            typeof(string), typeof(UILAGPL),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLPLBChanged));
        public string LPLB
        {
            get
            {
                return (string)GetValue(LPLBProperty);
            }
            set
            {
                SetValue(LPLBProperty, value);
                OnLPLBChg(value);

            }
        }
        private static void OnLPLBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILAGPL;
            if (src != null)
            {
                src.LPLB = (string)e.NewValue;
            }
        }
        #endregion

        #region ==LPLP===========
        public static readonly DependencyProperty LPLPProperty = DependencyProperty.Register("LPLP",
            typeof(string), typeof(UILAGPL),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLPLPChanged));
        public string LPLP
        {
            get
            {
                return (string)GetValue(LPLPProperty);
            }
            set
            {
                SetValue(LPLPProperty, value);
                OnLPLPChg(value);

            }
        }
        private static void OnLPLPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILAGPL;
            if (src != null)
            {
                src.LPLP = (string)e.NewValue;
            }
        }
        #endregion

    }
}
